Report post

What is a universal selector in CSS?

The universal selector (*) selects all HTML elements on the page. The CSS rule below will affect every HTML element on the page: The grouping selector selects all the HTML elements with the same style definitions. Look at the following CSS code (the h1, h2, and p elements have the same style definitions):

What is a subject of a selector?

The element or elements which are selected by the selector are referred to as the subject of the selector. In other articles you may have met some different selectors, and learned that there are selectors that target the document in different ways — for example by selecting an element such as h1, or a class such as .special.

Can a selector be grouped in a document?

You can place any valid selector in a group, and all elements in the document that match all the grouped elements will have the same style based on that style property. Some designers prefer to list the grouped elements on separate lines for legibility in the code. The appearance on the website and the load speed remains the same.

What is a use case for multiple class selectors separated by descendant combinators?

A common real-world use case for multiple class selectors separated by descendant combinators is when a site has a different body class for certain pages, or certain devices. For example, consider this markup of a simple web site. Besides the header and footer, it also has a content column and two sidebars:

The World's Leading Crypto Trading Platform

Get my welcome gifts